package com.ruoyi.controller.redismq.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.StringRedisTemplate;

/**
 * 注册redistemplate作为消息的发布者
 *
 * @author lxr
 * 2019年3月5日 14:46:13
 */
@Configuration
public class PublisherConfig {
    @Bean
    public StringRedisTemplate initStringRedisTemplate(RedisConnectionFactory redisConnectionFactory) {
        return new StringRedisTemplate(redisConnectionFactory);
    }
}

